import { Component, OnInit } from '@angular/core';

import { PersonLiveService } from './person.live.service';

import { Util } from '../../../utils/util';

import { LiveBase } from '../live.base';

@Component({
  selector: 'live-person',
  templateUrl: './person.live.html',
  styleUrls: ['./person.live.css'],
  providers: [PersonLiveService]
})

export class PersonLive extends LiveBase {

  liver: any;

  constructor(public service: PersonLiveService, private util: Util) {

    super(service);

    this.liver = this.util.sessionStore().get('liveDetail');

  }


  ngOnInit() {

    console.log(this.liver);

    this.param.darenId = this.liver.darenId;

    var res = {"code":0,"msg":"成功","data":{"value":[{"liveId":200441651899,"darenId":263817957,"title":"韩范起源","viewCount":104501,"praiseCount":1325384,"price":55.18,"sellAmount":97,"sellMoney":5352.0,"startTime":1510279889000,"crawlTime":1510412526000},{"liveId":200442799657,"darenId":263817957,"title":"闺蜜陪你一起疯抢","viewCount":75305,"praiseCount":606574,"price":302.98,"sellAmount":25401,"sellMoney":7696101.0,"startTime":1510393011000,"crawlTime":1510460752000},{"liveId":200389524396,"darenId":263817957,"title":"天冷了，添件衣服吧","viewCount":37096,"praiseCount":76235,"price":140.84,"sellAmount":246,"sellMoney":34647.0,"startTime":1507615602000,"crawlTime":1507969545000},{"liveId":200429879312,"darenId":263817957,"title":"双十一攻略讲解大全","viewCount":34831,"praiseCount":112509,"price":23.1,"sellAmount":42,"sellMoney":970.0,"startTime":1509603435000,"crawlTime":1509969936000},{"liveId":200430975143,"darenId":263817957,"title":"撩拨你的男神女神","viewCount":33064,"praiseCount":222235,"price":50.0,"sellAmount":5,"sellMoney":250.0,"startTime":1509689967000,"crawlTime":1509971365000},{"liveId":200382578957,"darenId":263817957,"title":"假期好看也有料","viewCount":32610,"praiseCount":61998,"price":176.9,"sellAmount":52,"sellMoney":9199.0,"startTime":1506995772000,"crawlTime":1507283986000},{"liveId":200392289478,"darenId":263817957,"title":"温暖你的秋冬季","viewCount":31630,"praiseCount":32978,"price":241.31,"sellAmount":293,"sellMoney":70705.0,"startTime":1507789581000,"crawlTime":1508227920000},{"liveId":200415169767,"darenId":263817957,"title":"潮搭风情甜美风","viewCount":27763,"praiseCount":21953,"price":40.52,"sellAmount":147,"sellMoney":5956.0,"startTime":1508999736000,"crawlTime":1509180222000},{"liveId":200394500696,"darenId":263817957,"title":"专属于你的秋冬时尚","viewCount":26958,"praiseCount":35568,"price":187.84,"sellAmount":1887,"sellMoney":354447.0,"startTime":1507875401000,"crawlTime":1508399224000},{"liveId":200391612890,"darenId":263817957,"title":"给你们最期待的冬装","viewCount":26841,"praiseCount":35001,"price":384.84,"sellAmount":96,"sellMoney":36945.0,"startTime":1507701989000,"crawlTime":1508139801000}],"count":17}};
    
        setTimeout(() => {
    
          this.vm.table.livers = res.data.value;
    
          this.vm.table.count = res.data.count;
    
        }, 100);
  }
}
